package WGH;

import java.util.*;

public class AssignmentTable {
	
	private HashMap<Person,Room> AT;
	Iterator iter = null;
	
	public Iterator getIter() {	
		return iter= getAT().entrySet().iterator();
	}
	
	public AssignmentTable(){
		setAT(new HashMap<Person,Room>());
	}
	
	public void insert(Person p,Room r) {
		getAT().put(p, r);
		p.setRoom(r);
		r.assign(p);
	}

	public boolean selectName(Person person, Room room) {
		return room.equals(getAT().get(person));
	}
	@Override
	public String toString(){
		return getAT().toString();		
	}

	public HashMap<Person,Room> getAT() {
		return AT;
	}

	public void setAT(HashMap<Person,Room> aT) {
		AT = aT;
	}
}
